

#ifndef HiGraphQueue_h_
#include "HiGraphQueue.h"
#endif

#ifndef HiGraphTimer_h_
#include "HiGraphTimer.h"
#endif

#ifndef __TELE_MAIN_TIMERS_H__
#include "teleMainTimers.h"
#endif

#ifndef _teleLogTrace_h
#include "teleLogTrace.h"
#endif

#ifndef _RmtCfgGetCfgStateHigraph_h
#include "RmtCfgGetCfgStateHigraph.h"
#endif

#ifndef _RmtCfgStateEvt_h
#include "RmtCfgStateEvt.h"
#endif

#ifndef RmtCfgGetCfgStateFile_H
#include "RmtCfgGetCfgStateFile.h"
#endif

#ifndef _entIMediaMSGQ_h
//#include "entIMediaMSGQ.h"
#endif

#include "HiGraphStateGenerator.h"
#include "tlmRmtCfgSrvRpcCommonDesc.h"
#include "tlmRmtCfgSrvApp.h"


extern HiGraphQueue gTeleQueue;
extern HiGraphTimer gTeleTimer;




/**
 * \brief RmtCfgGetCfgStateHigraph:
 *
 * 		This function is a constructor of this class.
 *
 * \details
 *		Intialize all member variables.
 *
 * \param [in]
 *
 * \return
 */
RmtCfgGetCfgStateHigraph::RmtCfgGetCfgStateHigraph()
{
	LOG_PRINT(DPCA_TELE_CONNMGR_INFO,"[TELE]:RmtCfgGetCfgStateHigraph::RmtCfgGetCfgStateHigraph Consturctor\n");

    m_CurrentState  = 0;
    m_StateChart    = HiGraphGetRmtCfg;

}


/**
 * \brief ~RmtCfgGetCfgStateHigraph
 *
 * This function is a disstructor of this class.
 *
 *
 * \details
 *
 * \param [in]
 *
 * \return
 */
RmtCfgGetCfgStateHigraph::~RmtCfgGetCfgStateHigraph()
{
}

uint16_t RmtCfgGetCfgStateHigraph::OnCompletGetCfg(uint32_t para)
{
    
    return 0;
}

uint16_t RmtCfgGetCfgStateHigraph::OnGetCfgTimeOut(uint32_t para)
{
    //here para is the pointer to a message instance

    LOG_PRINT(DPCA_TELE_MAIN_INFO,"[TLM_MSGSRV]:<%s>\n", __FUNCTION__);

    tlmRmtCfgSrvApp* pRPCHandler = const_cast<tlmRmtCfgSrvApp*>(tlmRmtCfgSrvApp::GetInstance());
    if (pRPCHandler){
    	pRPCHandler->tlmRmtCfgSrvApp_makeAsyncCall(	FUNCID_TLM_RMT_CFG_GET_CFG_TIME_OUT,
    											reinterpret_cast<DWORD*>(&para),
    											sizeof(para) );
    }
    return 0;
}


uint16_t RmtCfgGetCfgStateHigraph::CheckNewGetCfgMsg(uint32_t para)
{
    //here para is the pointer to a message instance

    LOG_PRINT(DPCA_TELE_MAIN_INFO,"[TLM_MSGSRV]:<%s>\n", __FUNCTION__);

    tlmRmtCfgSrvApp* pRPCHandler = const_cast<tlmRmtCfgSrvApp*>(tlmRmtCfgSrvApp::GetInstance());
    if (pRPCHandler){
    	pRPCHandler->tlmRmtCfgSrvApp_makeAsyncCall(	FUNCID_TLM_RMT_CFG_CHECK_NEW_GET_CFG_MSG ,
    											reinterpret_cast<DWORD*>(&para),
    											sizeof(para) );
    }
    return 0;
}

uint16_t RmtCfgGetCfgStateHigraph::onReceiveNewGetCfgMsg(uint32_t para)
{
    LOG_PRINT(DPCA_TELE_MAIN_INFO,"[TLM_MSGSRV]:<%s>\n", __FUNCTION__);

    tlmRmtCfgSrvApp* pRPCHandler = const_cast<tlmRmtCfgSrvApp*>(tlmRmtCfgSrvApp::GetInstance());
    if (pRPCHandler){
    	pRPCHandler->tlmRmtCfgSrvApp_makeAsyncCall(	FUNCID_TLM_RMT_CFG_ON_RCV_NEW_GET_CFG_MSG ,
    											reinterpret_cast<DWORD*>(&para),
    											sizeof(para) );
    }
    return 0;
}


uint16_t RmtCfgGetCfgStateHigraph::HandleGetCfgMsg(uint32_t para)
{
    //here para is the pointer to a message instance

    LOG_PRINT(DPCA_TELE_MAIN_INFO,"[TLM]:RmtCfgGetCfgStateHigraph::HandleGetCfgMsg(0x%x)\n",para);

	tlmRmtCfgSrvApp* pRPCHandler = const_cast<tlmRmtCfgSrvApp*>(tlmRmtCfgSrvApp::GetInstance());
	if (pRPCHandler){
		pRPCHandler->tlmRmtCfgSrvApp_makeAsyncCall(	FUNCID_TLM_RMT_CFG_HANDLE_GET_CFG_MSG ,
												reinterpret_cast<DWORD*>(&para),
												sizeof(para) );
	}
    return 0;
}

uint16_t RmtCfgGetCfgStateHigraph::SendParaMsg(uint32_t para)
{
    //here para is the pointer to a message instance

    LOG_PRINT(DPCA_TELE_MAIN_INFO,"[TLM]:RmtCfgGetCfgStateHigraph::SendParaMsg(0x%x)\n",para);

	tlmRmtCfgSrvApp* pRPCHandler = const_cast<tlmRmtCfgSrvApp*>(tlmRmtCfgSrvApp::GetInstance());
	if (pRPCHandler){
		pRPCHandler->tlmRmtCfgSrvApp_makeAsyncCall(	FUNCID_TLM_RMT_CFG_SEND_PARA_MSG ,
												reinterpret_cast<DWORD*>(para),
												sizeof(para) );
	}
    return 0;
}

